home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / fax / leffler / contrib / dialrules / dialrules.ext.Z / dialrules.ext
Text File  |  1995-03-01  |  2KB  |  49 lines

  1. ! $Header: /usr/people/sam/fax/etc/RCS/dialrules,v 1.4 1995/01/23 20:37:42 sam Exp $
  2. !
  3. ! HylaFAX (tm) Dialing String Processing Rules,
  4. ! for office 3 digit extension systems where you dial 9 for outside lines.
  5. !
  6. ! This file describes how to process user-specified dialing strings
  7. ! to create two items:
  8. !
  9. ! CanonicalNumber: a unique string that is derived from all dialing
  10. ! strings to the same destination phone number.  This string is used
  11. ! by the fax server for ``naming'' the destination. 
  12. !
  13. ! DialString: the string passed to the modem for use in dialing the
  14. ! telephone.  This string should be void of any characters that might
  15. ! confuse the modem.
  16. !
  17. Area=${AreaCode}        ! local area code
  18. Country=${CountryCode}        ! local country code
  19. IDPrefix=${InternationalPrefix}    ! prefix for placing an international call
  20. LDPrefix=${LongDistancePrefix}    ! prefix for placing a long distance call
  21. !
  22. WS="     "            ! our notion of white space
  23. !
  24. ! Convert a phone number to a canonical format:
  25. !
  26. !    +<country><areacode><rest>
  27. !
  28. ! by (possibly) stripping off leading dialing prefixes for
  29. ! long distance and/or international dialing.
  30. !
  31. CanonicalNumber := [
  32. #.*            =            ! strip calling card stuff
  33. [^+0-9]+        =            ! strip white space etc.
  34. ^${IDPrefix}        = +            ! replace int. dialing code
  35. ^${LDPrefix}        = +${Country}        ! replace l.d. dialing code
  36. ^[^+]            = +${Country}${Area}&    ! otherwise, insert canon form
  37. ]
  38. !
  39. ! Process a dialing string according to local requirements.
  40. ! These rules do only one transformation: they convert in-country
  41. ! international calls to long-distance calls.
  42. !
  43. DialString := [
  44. [-${WS}.]+        =            ! strip syntactic sugar
  45. ^[+]${Country}        = ${LDPrefix}        ! long distance call
  46. ^[+]            = ${IDPrefix}        ! international call
  47. ^[0-9][0-9][0-9][0-9][0-9]+$    = 9,&        ! add 9 for outside calls
  48. ]
  49.